let app = getApp()
Page({
  data: {
    chain_rows:'',
    is_show_time:1
  },
  onLoad: function (options) {
    var that = this
    var goods_id = options.goods_id
    var shop_id = options.shop_id
    var goods_num = options.goods_num
    wx.request({
      url: app.configData.shop.api_url + '/index.php?ctl=Goods_Goods&met=chain&typ=json',
      method: 'GET',
      data: { goods_id: goods_id, shop_id: shop_id, goods_num: goods_num },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        
        if (res.data.status == 200) {
          that.setData({
            chain_rows: res.data.data.chain_rows,
          })
        } 
        that.setData({
          is_show_time: 0,
          goods_id: goods_id
        })

      }
    })
  },
  //马上自提
  ziti:function(e){
    var that = this
    var chain_id = e.currentTarget.dataset.chain_id
    if (chain_id){
      wx.redirectTo({
        url: '../ziti_confirm/ziti_confirm?goods_id=' + that.data.goods_id + '&chain_id=' + chain_id,
      })
    }
  },
})